<?php

namespace App\Http\Controllers\API\Admin;

use App\Http\Controllers\Controller;
use App\Miya\Models\ModuleType;
use Illuminate\Http\Request;

class ModuleTypeController extends Controller
{
    public function getValues()
    {
        $type = ModuleType::find(request()->get('q'));
        return collect($type->values)->map(function ($value) {
            return ['id' => $value['hash'], 'text' => $value['value']];
        });
    }
}
